﻿CREATE PROCEDURE [dbo].[yaf_user_recoverpassword](
                @BoardID  INT,
                @UserName NVARCHAR(50),
                @Email    NVARCHAR(50))
AS
    BEGIN
        DECLARE  @UserID INT
        SELECT @UserID = UserID
        FROM   yaf_User
        WHERE  BoardID = @BoardID
        AND Name = @UserName
        AND Email = @Email
        IF @UserID IS NULL
        BEGIN
            SELECT UserID = CONVERT(INT,NULL)
            RETURN
        END
        ELSE
        BEGIN
            SELECT UserID = @UserID
        END
    END


